package cios

import (
	"fmt"
	"math"
	"reflect"
	"sort"
)

type ApiGetSeriesImagesRequestStream []ApiGetSeriesImagesRequest

func ApiGetSeriesImagesRequestStreamOf(arg ...ApiGetSeriesImagesRequest) ApiGetSeriesImagesRequestStream {
	return arg
}
func ApiGetSeriesImagesRequestStreamFrom(arg []ApiGetSeriesImagesRequest) ApiGetSeriesImagesRequestStream {
	return arg
}
func CreateApiGetSeriesImagesRequestStream(arg ...ApiGetSeriesImagesRequest) *ApiGetSeriesImagesRequestStream {
	tmp := ApiGetSeriesImagesRequestStreamOf(arg...)
	return &tmp
}
func GenerateApiGetSeriesImagesRequestStream(arg []ApiGetSeriesImagesRequest) *ApiGetSeriesImagesRequestStream {
	tmp := ApiGetSeriesImagesRequestStreamFrom(arg)
	return &tmp
}

func (self *ApiGetSeriesImagesRequestStream) Add(arg ApiGetSeriesImagesRequest) *ApiGetSeriesImagesRequestStream {
	return self.AddAll(arg)
}
func (self *ApiGetSeriesImagesRequestStream) AddAll(arg ...ApiGetSeriesImagesRequest) *ApiGetSeriesImagesRequestStream {
	*self = append(*self, arg...)
	return self
}
func (self *ApiGetSeriesImagesRequestStream) AddSafe(arg *ApiGetSeriesImagesRequest) *ApiGetSeriesImagesRequestStream {
	if arg != nil {
		self.Add(*arg)
	}
	return self
}
func (self *ApiGetSeriesImagesRequestStream) Aggregate(fn func(ApiGetSeriesImagesRequest, ApiGetSeriesImagesRequest) ApiGetSeriesImagesRequest) *ApiGetSeriesImagesRequestStream {
	result := ApiGetSeriesImagesRequestStreamOf()
	self.ForEach(func(v ApiGetSeriesImagesRequest, i int) {
		if i == 0 {
			result.Add(fn(ApiGetSeriesImagesRequest{}, v))
		} else {
			result.Add(fn(result[i-1], v))
		}
	})
	*self = result
	return self
}
func (self *ApiGetSeriesImagesRequestStream) AllMatch(fn func(ApiGetSeriesImagesRequest, int) bool) bool {
	for i, v := range *self {
		if !fn(v, i) {
			return false
		}
	}
	return true
}
func (self *ApiGetSeriesImagesRequestStream) AnyMatch(fn func(ApiGetSeriesImagesRequest, int) bool) bool {
	for i, v := range *self {
		if fn(v, i) {
			return true
		}
	}
	return false
}
func (self *ApiGetSeriesImagesRequestStream) Clone() *ApiGetSeriesImagesRequestStream {
	temp := make([]ApiGetSeriesImagesRequest, self.Len())
	copy(temp, *self)
	return (*ApiGetSeriesImagesRequestStream)(&temp)
}
func (self *ApiGetSeriesImagesRequestStream) Copy() *ApiGetSeriesImagesRequestStream {
	return self.Clone()
}
func (self *ApiGetSeriesImagesRequestStream) Concat(arg []ApiGetSeriesImagesRequest) *ApiGetSeriesImagesRequestStream {
	return self.AddAll(arg...)
}
func (self *ApiGetSeriesImagesRequestStream) Contains(arg ApiGetSeriesImagesRequest) bool {
	return self.FindIndex(func(_arg ApiGetSeriesImagesRequest, index int) bool { return reflect.DeepEqual(_arg, arg) }) != -1
}
func (self *ApiGetSeriesImagesRequestStream) Clean() *ApiGetSeriesImagesRequestStream {
	*self = ApiGetSeriesImagesRequestStreamOf()
	return self
}
func (self *ApiGetSeriesImagesRequestStream) Delete(index int) *ApiGetSeriesImagesRequestStream {
	return self.DeleteRange(index, index)
}
func (self *ApiGetSeriesImagesRequestStream) DeleteRange(startIndex, endIndex int) *ApiGetSeriesImagesRequestStream {
	*self = append((*self)[:startIndex], (*self)[endIndex+1:]...)
	return self
}
func (self *ApiGetSeriesImagesRequestStream) Distinct() *ApiGetSeriesImagesRequestStream {
	caches := map[string]bool{}
	result := ApiGetSeriesImagesRequestStreamOf()
	for _, v := range *self {
		key := fmt.Sprintf("%+v", v)
		if f, ok := caches[key]; ok {
			if !f {
				result = append(result, v)
			}
		} else if caches[key] = true; !f {
			result = append(result, v)
		}

	}
	*self = result
	return self
}
func (self *ApiGetSeriesImagesRequestStream) Each(fn func(ApiGetSeriesImagesRequest)) *ApiGetSeriesImagesRequestStream {
	for _, v := range *self {
		fn(v)
	}
	return self
}
func (self *ApiGetSeriesImagesRequestStream) EachRight(fn func(ApiGetSeriesImagesRequest)) *ApiGetSeriesImagesRequestStream {
	for i := self.Len() - 1; i >= 0; i-- {
		fn(*self.Get(i))
	}
	return self
}
func (self *ApiGetSeriesImagesRequestStream) Equals(arr []ApiGetSeriesImagesRequest) bool {
	if (*self == nil) != (arr == nil) || len(*self) != len(arr) {
		return false
	}
	for i := range *self {
		if !reflect.DeepEqual((*self)[i], arr[i]) {
			return false
		}
	}
	return true
}
func (self *ApiGetSeriesImagesRequestStream) Filter(fn func(ApiGetSeriesImagesRequest, int) bool) *ApiGetSeriesImagesRequestStream {
	result := ApiGetSeriesImagesRequestStreamOf()
	for i, v := range *self {
		if fn(v, i) {
			result.Add(v)
		}
	}
	*self = result
	return self
}
func (self *ApiGetSeriesImagesRequestStream) FilterSlim(fn func(ApiGetSeriesImagesRequest, int) bool) *ApiGetSeriesImagesRequestStream {
	result := ApiGetSeriesImagesRequestStreamOf()
	caches := map[string]bool{}
	for i, v := range *self {
		key := fmt.Sprintf("%+v", v)
		if f, ok := caches[key]; ok {
			if f {
				result.Add(v)
			}
		} else if caches[key] = fn(v, i); caches[key] {
			result.Add(v)

		}
	}
	*self = result
	return self
}
func (self *ApiGetSeriesImagesRequestStream) Find(fn func(ApiGetSeriesImagesRequest, int) bool) *ApiGetSeriesImagesRequest {
	if i := self.FindIndex(fn); -1 != i {
		tmp := (*self)[i]
		return &tmp
	}
	return nil
}
func (self *ApiGetSeriesImagesRequestStream) FindOr(fn func(ApiGetSeriesImagesRequest, int) bool, or ApiGetSeriesImagesRequest) ApiGetSeriesImagesRequest {
	if v := self.Find(fn); v != nil {
		return *v
	}
	return or
}
func (self *ApiGetSeriesImagesRequestStream) FindIndex(fn func(ApiGetSeriesImagesRequest, int) bool) int {
	if self == nil {
		return -1
	}
	for i, v := range *self {
		if fn(v, i) {
			return i
		}
	}
	return -1
}
func (self *ApiGetSeriesImagesRequestStream) First() *ApiGetSeriesImagesRequest {
	return self.Get(0)
}
func (self *ApiGetSeriesImagesRequestStream) FirstOr(arg ApiGetSeriesImagesRequest) ApiGetSeriesImagesRequest {
	if v := self.Get(0); v != nil {
		return *v
	}
	return arg
}
func (self *ApiGetSeriesImagesRequestStream) ForEach(fn func(ApiGetSeriesImagesRequest, int)) *ApiGetSeriesImagesRequestStream {
	for i, v := range *self {
		fn(v, i)
	}
	return self
}
func (self *ApiGetSeriesImagesRequestStream) ForEachRight(fn func(ApiGetSeriesImagesRequest, int)) *ApiGetSeriesImagesRequestStream {
	for i := self.Len() - 1; i >= 0; i-- {
		fn(*self.Get(i), i)
	}
	return self
}
func (self *ApiGetSeriesImagesRequestStream) GroupBy(fn func(ApiGetSeriesImagesRequest, int) string) map[string][]ApiGetSeriesImagesRequest {
	m := map[string][]ApiGetSeriesImagesRequest{}
	for i, v := range self.Val() {
		key := fn(v, i)
		m[key] = append(m[key], v)
	}
	return m
}
func (self *ApiGetSeriesImagesRequestStream) GroupByValues(fn func(ApiGetSeriesImagesRequest, int) string) [][]ApiGetSeriesImagesRequest {
	var tmp [][]ApiGetSeriesImagesRequest
	for _, v := range self.GroupBy(fn) {
		tmp = append(tmp, v)
	}
	return tmp
}
func (self *ApiGetSeriesImagesRequestStream) IndexOf(arg ApiGetSeriesImagesRequest) int {
	for index, _arg := range *self {
		if reflect.DeepEqual(_arg, arg) {
			return index
		}
	}
	return -1
}
func (self *ApiGetSeriesImagesRequestStream) IsEmpty() bool {
	return self.Len() == 0
}
func (self *ApiGetSeriesImagesRequestStream) IsPreset() bool {
	return !self.IsEmpty()
}
func (self *ApiGetSeriesImagesRequestStream) Last() *ApiGetSeriesImagesRequest {
	return self.Get(self.Len() - 1)
}
func (self *ApiGetSeriesImagesRequestStream) LastOr(arg ApiGetSeriesImagesRequest) ApiGetSeriesImagesRequest {
	if v := self.Last(); v != nil {
		return *v
	}
	return arg
}
func (self *ApiGetSeriesImagesRequestStream) Len() int {
	if self == nil {
		return 0
	}
	return len(*self)
}
func (self *ApiGetSeriesImagesRequestStream) Limit(limit int) *ApiGetSeriesImagesRequestStream {
	self.Slice(0, limit)
	return self
}

func (self *ApiGetSeriesImagesRequestStream) Map(fn func(ApiGetSeriesImagesRequest, int) interface{}) interface{} {
	_array := make([]interface{}, 0, len(*self))
	for i, v := range *self {
		_array = append(_array, fn(v, i))
	}
	return _array
}
func (self *ApiGetSeriesImagesRequestStream) Map2Int(fn func(ApiGetSeriesImagesRequest, int) int) []int {
	_array := make([]int, 0, len(*self))
	for i, v := range *self {
		_array = append(_array, fn(v, i))
	}
	return _array
}
func (self *ApiGetSeriesImagesRequestStream) Map2Int32(fn func(ApiGetSeriesImagesRequest, int) int32) []int32 {
	_array := make([]int32, 0, len(*self))
	for i, v := range *self {
		_array = append(_array, fn(v, i))
	}
	return _array
}
func (self *ApiGetSeriesImagesRequestStream) Map2Int64(fn func(ApiGetSeriesImagesRequest, int) int64) []int64 {
	_array := make([]int64, 0, len(*self))
	for i, v := range *self {
		_array = append(_array, fn(v, i))
	}
	return _array
}
func (self *ApiGetSeriesImagesRequestStream) Map2Float32(fn func(ApiGetSeriesImagesRequest, int) float32) []float32 {
	_array := make([]float32, 0, len(*self))
	for i, v := range *self {
		_array = append(_array, fn(v, i))
	}
	return _array
}
func (self *ApiGetSeriesImagesRequestStream) Map2Float64(fn func(ApiGetSeriesImagesRequest, int) float64) []float64 {
	_array := make([]float64, 0, len(*self))
	for i, v := range *self {
		_array = append(_array, fn(v, i))
	}
	return _array
}
func (self *ApiGetSeriesImagesRequestStream) Map2Bool(fn func(ApiGetSeriesImagesRequest, int) bool) []bool {
	_array := make([]bool, 0, len(*self))
	for i, v := range *self {
		_array = append(_array, fn(v, i))
	}
	return _array
}
func (self *ApiGetSeriesImagesRequestStream) Map2Bytes(fn func(ApiGetSeriesImagesRequest, int) []byte) [][]byte {
	_array := make([][]byte, 0, len(*self))
	for i, v := range *self {
		_array = append(_array, fn(v, i))
	}
	return _array
}
func (self *ApiGetSeriesImagesRequestStream) Map2String(fn func(ApiGetSeriesImagesRequest, int) string) []string {
	_array := make([]string, 0, len(*self))
	for i, v := range *self {
		_array = append(_array, fn(v, i))
	}
	return _array
}
func (self *ApiGetSeriesImagesRequestStream) Max(fn func(ApiGetSeriesImagesRequest, int) float64) *ApiGetSeriesImagesRequest {
	f := self.Get(0)
	if f == nil {
		return nil
	}
	m := fn(*f, 0)
	index := 0
	for i := 1; i < self.Len(); i++ {
		v := fn(*self.Get(i), i)
		m = math.Max(m, v)
		if m == v {
			index = i
		}
	}
	return self.Get(index)
}
func (self *ApiGetSeriesImagesRequestStream) Min(fn func(ApiGetSeriesImagesRequest, int) float64) *ApiGetSeriesImagesRequest {
	f := self.Get(0)
	if f == nil {
		return nil
	}
	m := fn(*f, 0)
	index := 0
	for i := 1; i < self.Len(); i++ {
		v := fn(*self.Get(i), i)
		m = math.Min(m, v)
		if m == v {
			index = i
		}
	}
	return self.Get(index)
}
func (self *ApiGetSeriesImagesRequestStream) NoneMatch(fn func(ApiGetSeriesImagesRequest, int) bool) bool {
	return !self.AnyMatch(fn)
}
func (self *ApiGetSeriesImagesRequestStream) Get(index int) *ApiGetSeriesImagesRequest {
	if self.Len() > index && index >= 0 {
		tmp := (*self)[index]
		return &tmp
	}
	return nil
}
func (self *ApiGetSeriesImagesRequestStream) GetOr(index int, arg ApiGetSeriesImagesRequest) ApiGetSeriesImagesRequest {
	if v := self.Get(index); v != nil {
		return *v
	}
	return arg
}
func (self *ApiGetSeriesImagesRequestStream) Peek(fn func(*ApiGetSeriesImagesRequest, int)) *ApiGetSeriesImagesRequestStream {
	for i, v := range *self {
		fn(&v, i)
		self.Set(i, v)
	}
	return self
}

func (self *ApiGetSeriesImagesRequestStream) Reduce(fn func(ApiGetSeriesImagesRequest, ApiGetSeriesImagesRequest, int) ApiGetSeriesImagesRequest) *ApiGetSeriesImagesRequestStream {
	return self.ReduceInit(fn, ApiGetSeriesImagesRequest{})
}
func (self *ApiGetSeriesImagesRequestStream) ReduceInit(fn func(ApiGetSeriesImagesRequest, ApiGetSeriesImagesRequest, int) ApiGetSeriesImagesRequest, initialValue ApiGetSeriesImagesRequest) *ApiGetSeriesImagesRequestStream {
	result := ApiGetSeriesImagesRequestStreamOf()
	self.ForEach(func(v ApiGetSeriesImagesRequest, i int) {
		if i == 0 {
			result.Add(fn(initialValue, v, i))
		} else {
			result.Add(fn(result[i-1], v, i))
		}
	})
	*self = result
	return self
}
func (self *ApiGetSeriesImagesRequestStream) ReduceInterface(fn func(interface{}, ApiGetSeriesImagesRequest, int) interface{}) []interface{} {
	result := []interface{}{}
	for i, v := range *self {
		if i == 0 {
			result = append(result, fn(ApiGetSeriesImagesRequest{}, v, i))
		} else {
			result = append(result, fn(result[i-1], v, i))
		}
	}
	return result
}
func (self *ApiGetSeriesImagesRequestStream) ReduceString(fn func(string, ApiGetSeriesImagesRequest, int) string) []string {
	result := []string{}
	for i, v := range *self {
		if i == 0 {
			result = append(result, fn("", v, i))
		} else {
			result = append(result, fn(result[i-1], v, i))
		}
	}
	return result
}
func (self *ApiGetSeriesImagesRequestStream) ReduceInt(fn func(int, ApiGetSeriesImagesRequest, int) int) []int {
	result := []int{}
	for i, v := range *self {
		if i == 0 {
			result = append(result, fn(0, v, i))
		} else {
			result = append(result, fn(result[i-1], v, i))
		}
	}
	return result
}
func (self *ApiGetSeriesImagesRequestStream) ReduceInt32(fn func(int32, ApiGetSeriesImagesRequest, int) int32) []int32 {
	result := []int32{}
	for i, v := range *self {
		if i == 0 {
			result = append(result, fn(0, v, i))
		} else {
			result = append(result, fn(result[i-1], v, i))
		}
	}
	return result
}
func (self *ApiGetSeriesImagesRequestStream) ReduceInt64(fn func(int64, ApiGetSeriesImagesRequest, int) int64) []int64 {
	result := []int64{}
	for i, v := range *self {
		if i == 0 {
			result = append(result, fn(0, v, i))
		} else {
			result = append(result, fn(result[i-1], v, i))
		}
	}
	return result
}
func (self *ApiGetSeriesImagesRequestStream) ReduceFloat32(fn func(float32, ApiGetSeriesImagesRequest, int) float32) []float32 {
	result := []float32{}
	for i, v := range *self {
		if i == 0 {
			result = append(result, fn(0.0, v, i))
		} else {
			result = append(result, fn(result[i-1], v, i))
		}
	}
	return result
}
func (self *ApiGetSeriesImagesRequestStream) ReduceFloat64(fn func(float64, ApiGetSeriesImagesRequest, int) float64) []float64 {
	result := []float64{}
	for i, v := range *self {
		if i == 0 {
			result = append(result, fn(0.0, v, i))
		} else {
			result = append(result, fn(result[i-1], v, i))
		}
	}
	return result
}
func (self *ApiGetSeriesImagesRequestStream) ReduceBool(fn func(bool, ApiGetSeriesImagesRequest, int) bool) []bool {
	result := []bool{}
	for i, v := range *self {
		if i == 0 {
			result = append(result, fn(false, v, i))
		} else {
			result = append(result, fn(result[i-1], v, i))
		}
	}
	return result
}
func (self *ApiGetSeriesImagesRequestStream) Reverse() *ApiGetSeriesImagesRequestStream {
	for i, j := 0, self.Len()-1; i < j; i, j = i+1, j-1 {
		(*self)[i], (*self)[j] = (*self)[j], (*self)[i]
	}
	return self
}
func (self *ApiGetSeriesImagesRequestStream) Replace(fn func(ApiGetSeriesImagesRequest, int) ApiGetSeriesImagesRequest) *ApiGetSeriesImagesRequestStream {
	return self.ForEach(func(v ApiGetSeriesImagesRequest, i int) { self.Set(i, fn(v, i)) })
}
func (self *ApiGetSeriesImagesRequestStream) Select(fn func(ApiGetSeriesImagesRequest) interface{}) interface{} {
	_array := make([]interface{}, 0, len(*self))
	for _, v := range *self {
		_array = append(_array, fn(v))
	}
	return _array
}
func (self *ApiGetSeriesImagesRequestStream) Set(index int, val ApiGetSeriesImagesRequest) *ApiGetSeriesImagesRequestStream {
	if len(*self) > index && index >= 0 {
		(*self)[index] = val
	}
	return self
}
func (self *ApiGetSeriesImagesRequestStream) Skip(skip int) *ApiGetSeriesImagesRequestStream {
	return self.Slice(skip, self.Len()-skip)
}
func (self *ApiGetSeriesImagesRequestStream) SkippingEach(fn func(ApiGetSeriesImagesRequest, int) int) *ApiGetSeriesImagesRequestStream {
	for i := 0; i < self.Len(); i++ {
		skip := fn(*self.Get(i), i)
		i += skip
	}
	return self
}
func (self *ApiGetSeriesImagesRequestStream) Slice(startIndex, n int) *ApiGetSeriesImagesRequestStream {
	if last := startIndex + n; len(*self)-1 < startIndex || last < 0 || startIndex < 0 {
		*self = []ApiGetSeriesImagesRequest{}
	} else if len(*self) < last {
		*self = (*self)[startIndex:len(*self)]
	} else {
		*self = (*self)[startIndex:last]
	}
	return self
}
func (self *ApiGetSeriesImagesRequestStream) Sort(fn func(i, j int) bool) *ApiGetSeriesImagesRequestStream {
	sort.SliceStable(*self, fn)
	return self
}

func (self *ApiGetSeriesImagesRequestStream) Tail() *ApiGetSeriesImagesRequest {
	return self.Last()
}
func (self *ApiGetSeriesImagesRequestStream) TailOr(arg ApiGetSeriesImagesRequest) ApiGetSeriesImagesRequest {
	return self.LastOr(arg)
}
func (self *ApiGetSeriesImagesRequestStream) ToList() []ApiGetSeriesImagesRequest {
	return self.Val()
}
func (self *ApiGetSeriesImagesRequestStream) Unique() *ApiGetSeriesImagesRequestStream {
	return self.Distinct()
}
func (self *ApiGetSeriesImagesRequestStream) Val() []ApiGetSeriesImagesRequest {
	if self == nil {
		return []ApiGetSeriesImagesRequest{}
	}
	return *self.Copy()
}
func (self *ApiGetSeriesImagesRequestStream) While(fn func(ApiGetSeriesImagesRequest, int) bool) *ApiGetSeriesImagesRequestStream {
	for i, v := range self.Val() {
		if !fn(v, i) {
			break
		}
	}
	return self
}
func (self *ApiGetSeriesImagesRequestStream) Where(fn func(ApiGetSeriesImagesRequest) bool) *ApiGetSeriesImagesRequestStream {
	result := ApiGetSeriesImagesRequestStreamOf()
	for _, v := range *self {
		if fn(v) {
			result.Add(v)
		}
	}
	*self = result
	return self
}
func (self *ApiGetSeriesImagesRequestStream) WhereSlim(fn func(ApiGetSeriesImagesRequest) bool) *ApiGetSeriesImagesRequestStream {
	result := ApiGetSeriesImagesRequestStreamOf()
	caches := map[string]bool{}
	for _, v := range *self {
		key := fmt.Sprintf("%+v", v)
		if f, ok := caches[key]; ok {
			if f {
				result.Add(v)
			}
		} else if caches[key] = fn(v); caches[key] {
			result.Add(v)
		}
	}
	*self = result
	return self
}
/*
 * Collection utility of ApiGetSeriesImagesRequest Struct
 *
 * Generated by: Go Streamer
 */

package cios

import (
	"fmt"
	"math"
	"reflect"
	"sort"
)

type ApiGetSeriesImagesRequestStream []ApiGetSeriesImagesRequest

func ApiGetSeriesImagesRequestStreamOf(arg ...ApiGetSeriesImagesRequest) ApiGetSeriesImagesRequestStream {
	return arg
}
func ApiGetSeriesImagesRequestStreamFrom(arg []ApiGetSeriesImagesRequest) ApiGetSeriesImagesRequestStream {
	return arg
}
func CreateApiGetSeriesImagesRequestStream(arg ...ApiGetSeriesImagesRequest) *ApiGetSeriesImagesRequestStream {
	tmp := ApiGetSeriesImagesRequestStreamOf(arg...)
	return &tmp
}
func GenerateApiGetSeriesImagesRequestStream(arg []ApiGetSeriesImagesRequest) *ApiGetSeriesImagesRequestStream {
	tmp := ApiGetSeriesImagesRequestStreamFrom(arg)
	return &tmp
}

func (self *ApiGetSeriesImagesRequestStream) Add(arg ApiGetSeriesImagesRequest) *ApiGetSeriesImagesRequestStream {
	return self.AddAll(arg)
}
func (self *ApiGetSeriesImagesRequestStream) AddAll(arg ...ApiGetSeriesImagesRequest) *ApiGetSeriesImagesRequestStream {
	*self = append(*self, arg...)
	return self
}
func (self *ApiGetSeriesImagesRequestStream) AddSafe(arg *ApiGetSeriesImagesRequest) *ApiGetSeriesImagesRequestStream {
	if arg != nil {
		self.Add(*arg)
	}
	return self
}
func (self *ApiGetSeriesImagesRequestStream) Aggregate(fn func(ApiGetSeriesImagesRequest, ApiGetSeriesImagesRequest) ApiGetSeriesImagesRequest) *ApiGetSeriesImagesRequestStream {
	result := ApiGetSeriesImagesRequestStreamOf()
	self.ForEach(func(v ApiGetSeriesImagesRequest, i int) {
		if i == 0 {
			result.Add(fn(ApiGetSeriesImagesRequest{}, v))
		} else {
			result.Add(fn(result[i-1], v))
		}
	})
	*self = result
	return self
}
func (self *ApiGetSeriesImagesRequestStream) AllMatch(fn func(ApiGetSeriesImagesRequest, int) bool) bool {
	for i, v := range *self {
		if !fn(v, i) {
			return false
		}
	}
	return true
}
func (self *ApiGetSeriesImagesRequestStream) AnyMatch(fn func(ApiGetSeriesImagesRequest, int) bool) bool {
	for i, v := range *self {
		if fn(v, i) {
			return true
		}
	}
	return false
}
func (self *ApiGetSeriesImagesRequestStream) Clone() *ApiGetSeriesImagesRequestStream {
	temp := make([]ApiGetSeriesImagesRequest, self.Len())
	copy(temp, *self)
	return (*ApiGetSeriesImagesRequestStream)(&temp)
}
func (self *ApiGetSeriesImagesRequestStream) Copy() *ApiGetSeriesImagesRequestStream {
	return self.Clone()
}
func (self *ApiGetSeriesImagesRequestStream) Concat(arg []ApiGetSeriesImagesRequest) *ApiGetSeriesImagesRequestStream {
	return self.AddAll(arg...)
}
func (self *ApiGetSeriesImagesRequestStream) Contains(arg ApiGetSeriesImagesRequest) bool {
	return self.FindIndex(func(_arg ApiGetSeriesImagesRequest, index int) bool { return reflect.DeepEqual(_arg, arg) }) != -1
}
func (self *ApiGetSeriesImagesRequestStream) Clean() *ApiGetSeriesImagesRequestStream {
	*self = ApiGetSeriesImagesRequestStreamOf()
	return self
}
func (self *ApiGetSeriesImagesRequestStream) Delete(index int) *ApiGetSeriesImagesRequestStream {
	return self.DeleteRange(index, index)
}
func (self *ApiGetSeriesImagesRequestStream) DeleteRange(startIndex, endIndex int) *ApiGetSeriesImagesRequestStream {
	*self = append((*self)[:startIndex], (*self)[endIndex+1:]...)
	return self
}
func (self *ApiGetSeriesImagesRequestStream) Distinct() *ApiGetSeriesImagesRequestStream {
	caches := map[string]bool{}
	result := ApiGetSeriesImagesRequestStreamOf()
	for _, v := range *self {
		key := fmt.Sprintf("%+v", v)
		if f, ok := caches[key]; ok {
			if !f {
				result = append(result, v)
			}
		} else if caches[key] = true; !f {
			result = append(result, v)
		}

	}
	*self = result
	return self
}
func (self *ApiGetSeriesImagesRequestStream) Each(fn func(ApiGetSeriesImagesRequest)) *ApiGetSeriesImagesRequestStream {
	for _, v := range *self {
		fn(v)
	}
	return self
}
func (self *ApiGetSeriesImagesRequestStream) EachRight(fn func(ApiGetSeriesImagesRequest)) *ApiGetSeriesImagesRequestStream {
	for i := self.Len() - 1; i >= 0; i-- {
		fn(*self.Get(i))
	}
	return self
}
func (self *ApiGetSeriesImagesRequestStream) Equals(arr []ApiGetSeriesImagesRequest) bool {
	if (*self == nil) != (arr == nil) || len(*self) != len(arr) {
		return false
	}
	for i := range *self {
		if !reflect.DeepEqual((*self)[i], arr[i]) {
			return false
		}
	}
	return true
}
func (self *ApiGetSeriesImagesRequestStream) Filter(fn func(ApiGetSeriesImagesRequest, int) bool) *ApiGetSeriesImagesRequestStream {
	result := ApiGetSeriesImagesRequestStreamOf()
	for i, v := range *self {
		if fn(v, i) {
			result.Add(v)
		}
	}
	*self = result
	return self
}
func (self *ApiGetSeriesImagesRequestStream) FilterSlim(fn func(ApiGetSeriesImagesRequest, int) bool) *ApiGetSeriesImagesRequestStream {
	result := ApiGetSeriesImagesRequestStreamOf()
	caches := map[string]bool{}
	for i, v := range *self {
		key := fmt.Sprintf("%+v", v)
		if f, ok := caches[key]; ok {
			if f {
				result.Add(v)
			}
		} else if caches[key] = fn(v, i); caches[key] {
			result.Add(v)

		}
	}
	*self = result
	return self
}
func (self *ApiGetSeriesImagesRequestStream) Find(fn func(ApiGetSeriesImagesRequest, int) bool) *ApiGetSeriesImagesRequest {
	if i := self.FindIndex(fn); -1 != i {
		tmp := (*self)[i]
		return &tmp
	}
	return nil
}
func (self *ApiGetSeriesImagesRequestStream) FindOr(fn func(ApiGetSeriesImagesRequest, int) bool, or ApiGetSeriesImagesRequest) ApiGetSeriesImagesRequest {
	if v := self.Find(fn); v != nil {
		return *v
	}
	return or
}
func (self *ApiGetSeriesImagesRequestStream) FindIndex(fn func(ApiGetSeriesImagesRequest, int) bool) int {
	if self == nil {
		return -1
	}
	for i, v := range *self {
		if fn(v, i) {
			return i
		}
	}
	return -1
}
func (self *ApiGetSeriesImagesRequestStream) First() *ApiGetSeriesImagesRequest {
	return self.Get(0)
}
func (self *ApiGetSeriesImagesRequestStream) FirstOr(arg ApiGetSeriesImagesRequest) ApiGetSeriesImagesRequest {
	if v := self.Get(0); v != nil {
		return *v
	}
	return arg
}
func (self *ApiGetSeriesImagesRequestStream) ForEach(fn func(ApiGetSeriesImagesRequest, int)) *ApiGetSeriesImagesRequestStream {
	for i, v := range *self {
		fn(v, i)
	}
	return self
}
func (self *ApiGetSeriesImagesRequestStream) ForEachRight(fn func(ApiGetSeriesImagesRequest, int)) *ApiGetSeriesImagesRequestStream {
	for i := self.Len() - 1; i >= 0; i-- {
		fn(*self.Get(i), i)
	}
	return self
}
func (self *ApiGetSeriesImagesRequestStream) GroupBy(fn func(ApiGetSeriesImagesRequest, int) string) map[string][]ApiGetSeriesImagesRequest {
	m := map[string][]ApiGetSeriesImagesRequest{}
	for i, v := range self.Val() {
		key := fn(v, i)
		m[key] = append(m[key], v)
	}
	return m
}
func (self *ApiGetSeriesImagesRequestStream) GroupByValues(fn func(ApiGetSeriesImagesRequest, int) string) [][]ApiGetSeriesImagesRequest {
	var tmp [][]ApiGetSeriesImagesRequest
	for _, v := range self.GroupBy(fn) {
		tmp = append(tmp, v)
	}
	return tmp
}
func (self *ApiGetSeriesImagesRequestStream) IndexOf(arg ApiGetSeriesImagesRequest) int {
	for index, _arg := range *self {
		if reflect.DeepEqual(_arg, arg) {
			return index
		}
	}
	return -1
}
func (self *ApiGetSeriesImagesRequestStream) IsEmpty() bool {
	return self.Len() == 0
}
func (self *ApiGetSeriesImagesRequestStream) IsPreset() bool {
	return !self.IsEmpty()
}
func (self *ApiGetSeriesImagesRequestStream) Last() *ApiGetSeriesImagesRequest {
	return self.Get(self.Len() - 1)
}
func (self *ApiGetSeriesImagesRequestStream) LastOr(arg ApiGetSeriesImagesRequest) ApiGetSeriesImagesRequest {
	if v := self.Last(); v != nil {
		return *v
	}
	return arg
}
func (self *ApiGetSeriesImagesRequestStream) Len() int {
	if self == nil {
		return 0
	}
	return len(*self)
}
func (self *ApiGetSeriesImagesRequestStream) Limit(limit int) *ApiGetSeriesImagesRequestStream {
	self.Slice(0, limit)
	return self
}

func (self *ApiGetSeriesImagesRequestStream) Map(fn func(ApiGetSeriesImagesRequest, int) interface{}) interface{} {
	_array := make([]interface{}, 0, len(*self))
	for i, v := range *self {
		_array = append(_array, fn(v, i))
	}
	return _array
}
func (self *ApiGetSeriesImagesRequestStream) Map2Int(fn func(ApiGetSeriesImagesRequest, int) int) []int {
	_array := make([]int, 0, len(*self))
	for i, v := range *self {
		_array = append(_array, fn(v, i))
	}
	return _array
}
func (self *ApiGetSeriesImagesRequestStream) Map2Int32(fn func(ApiGetSeriesImagesRequest, int) int32) []int32 {
	_array := make([]int32, 0, len(*self))
	for i, v := range *self {
		_array = append(_array, fn(v, i))
	}
	return _array
}
func (self *ApiGetSeriesImagesRequestStream) Map2Int64(fn func(ApiGetSeriesImagesRequest, int) int64) []int64 {
	_array := make([]int64, 0, len(*self))
	for i, v := range *self {
		_array = append(_array, fn(v, i))
	}
	return _array
}
func (self *ApiGetSeriesImagesRequestStream) Map2Float32(fn func(ApiGetSeriesImagesRequest, int) float32) []float32 {
	_array := make([]float32, 0, len(*self))
	for i, v := range *self {
		_array = append(_array, fn(v, i))
	}
	return _array
}
func (self *ApiGetSeriesImagesRequestStream) Map2Float64(fn func(ApiGetSeriesImagesRequest, int) float64) []float64 {
	_array := make([]float64, 0, len(*self))
	for i, v := range *self {
		_array = append(_array, fn(v, i))
	}
	return _array
}
func (self *ApiGetSeriesImagesRequestStream) Map2Bool(fn func(ApiGetSeriesImagesRequest, int) bool) []bool {
	_array := make([]bool, 0, len(*self))
	for i, v := range *self {
		_array = append(_array, fn(v, i))
	}
	return _array
}
func (self *ApiGetSeriesImagesRequestStream) Map2Bytes(fn func(ApiGetSeriesImagesRequest, int) []byte) [][]byte {
	_array := make([][]byte, 0, len(*self))
	for i, v := range *self {
		_array = append(_array, fn(v, i))
	}
	return _array
}
func (self *ApiGetSeriesImagesRequestStream) Map2String(fn func(ApiGetSeriesImagesRequest, int) string) []string {
	_array := make([]string, 0, len(*self))
	for i, v := range *self {
		_array = append(_array, fn(v, i))
	}
	return _array
}
func (self *ApiGetSeriesImagesRequestStream) Max(fn func(ApiGetSeriesImagesRequest, int) float64) *ApiGetSeriesImagesRequest {
	f := self.Get(0)
	if f == nil {
		return nil
	}
	m := fn(*f, 0)
	index := 0
	for i := 1; i < self.Len(); i++ {
		v := fn(*self.Get(i), i)
		m = math.Max(m, v)
		if m == v {
			index = i
		}
	}
	return self.Get(index)
}
func (self *ApiGetSeriesImagesRequestStream) Min(fn func(ApiGetSeriesImagesRequest, int) float64) *ApiGetSeriesImagesRequest {
	f := self.Get(0)
	if f == nil {
		return nil
	}
	m := fn(*f, 0)
	index := 0
	for i := 1; i < self.Len(); i++ {
		v := fn(*self.Get(i), i)
		m = math.Min(m, v)
		if m == v {
			index = i
		}
	}
	return self.Get(index)
}
func (self *ApiGetSeriesImagesRequestStream) NoneMatch(fn func(ApiGetSeriesImagesRequest, int) bool) bool {
	return !self.AnyMatch(fn)
}
func (self *ApiGetSeriesImagesRequestStream) Get(index int) *ApiGetSeriesImagesRequest {
	if self.Len() > index && index >= 0 {
		tmp := (*self)[index]
		return &tmp
	}
	return nil
}
func (self *ApiGetSeriesImagesRequestStream) GetOr(index int, arg ApiGetSeriesImagesRequest) ApiGetSeriesImagesRequest {
	if v := self.Get(index); v != nil {
		return *v
	}
	return arg
}
func (self *ApiGetSeriesImagesRequestStream) Peek(fn func(*ApiGetSeriesImagesRequest, int)) *ApiGetSeriesImagesRequestStream {
	for i, v := range *self {
		fn(&v, i)
		self.Set(i, v)
	}
	return self
}


func (self *ApiGetSeriesImagesRequestStream) Reduce(fn func(ApiGetSeriesImagesRequest, ApiGetSeriesImagesRequest, int) ApiGetSeriesImagesRequest) *ApiGetSeriesImagesRequestStream {
	return self.ReduceInit(fn, ApiGetSeriesImagesRequest{})
}
func (self *ApiGetSeriesImagesRequestStream) ReduceInit(fn func(ApiGetSeriesImagesRequest, ApiGetSeriesImagesRequest, int) ApiGetSeriesImagesRequest, initialValue ApiGetSeriesImagesRequest) *ApiGetSeriesImagesRequestStream {
	result := ApiGetSeriesImagesRequestStreamOf()
	self.ForEach(func(v ApiGetSeriesImagesRequest, i int) {
		if i == 0 {
			result.Add(fn(initialValue, v, i))
		} else {
			result.Add(fn(result[i-1], v, i))
		}
	})
	*self = result
	return self
}
func (self *ApiGetSeriesImagesRequestStream) ReduceInterface(fn func(interface{}, ApiGetSeriesImagesRequest, int) interface{}) []interface{} {
	result := []interface{}{}
	for i, v := range *self {
		if i == 0 {
			result = append(result, fn(ApiGetSeriesImagesRequest{}, v, i))
		} else {
			result = append(result, fn(result[i-1], v, i))
		}
	}
	return result
}
func (self *ApiGetSeriesImagesRequestStream) ReduceString(fn func(string, ApiGetSeriesImagesRequest, int) string) []string {
	result := []string{}
	for i, v := range *self {
		if i == 0 {
			result = append(result, fn("", v, i))
		} else {
			result = append(result, fn(result[i-1], v, i))
		}
	}
	return result
}
func (self *ApiGetSeriesImagesRequestStream) ReduceInt(fn func(int, ApiGetSeriesImagesRequest, int) int) []int {
	result := []int{}
	for i, v := range *self {
		if i == 0 {
			result = append(result, fn(0, v, i))
		} else {
			result = append(result, fn(result[i-1], v, i))
		}
	}
	return result
}
func (self *ApiGetSeriesImagesRequestStream) ReduceInt32(fn func(int32, ApiGetSeriesImagesRequest, int) int32) []int32 {
	result := []int32{}
	for i, v := range *self {
		if i == 0 {
			result = append(result, fn(0, v, i))
		} else {
			result = append(result, fn(result[i-1], v, i))
		}
	}
	return result
}
func (self *ApiGetSeriesImagesRequestStream) ReduceInt64(fn func(int64, ApiGetSeriesImagesRequest, int) int64) []int64 {
	result := []int64{}
	for i, v := range *self {
		if i == 0 {
			result = append(result, fn(0, v, i))
		} else {
			result = append(result, fn(result[i-1], v, i))
		}
	}
	return result
}
func (self *ApiGetSeriesImagesRequestStream) ReduceFloat32(fn func(float32, ApiGetSeriesImagesRequest, int) float32) []float32 {
	result := []float32{}
	for i, v := range *self {
		if i == 0 {
			result = append(result, fn(0.0, v, i))
		} else {
			result = append(result, fn(result[i-1], v, i))
		}
	}
	return result
}
func (self *ApiGetSeriesImagesRequestStream) ReduceFloat64(fn func(float64, ApiGetSeriesImagesRequest, int) float64) []float64 {
	result := []float64{}
	for i, v := range *self {
		if i == 0 {
			result = append(result, fn(0.0, v, i))
		} else {
			result = append(result, fn(result[i-1], v, i))
		}
	}
	return result
}
func (self *ApiGetSeriesImagesRequestStream) ReduceBool(fn func(bool, ApiGetSeriesImagesRequest, int) bool) []bool {
	result := []bool{}
	for i, v := range *self {
		if i == 0 {
			result = append(result, fn(false, v, i))
		} else {
			result = append(result, fn(result[i-1], v, i))
		}
	}
	return result
}
func (self *ApiGetSeriesImagesRequestStream) Reverse() *ApiGetSeriesImagesRequestStream {
	for i, j := 0, self.Len()-1; i < j; i, j = i+1, j-1 {
		(*self)[i], (*self)[j] = (*self)[j], (*self)[i]
	}
	return self
}
func (self *ApiGetSeriesImagesRequestStream) Replace(fn func(ApiGetSeriesImagesRequest, int) ApiGetSeriesImagesRequest) *ApiGetSeriesImagesRequestStream {
	return self.ForEach(func(v ApiGetSeriesImagesRequest, i int) { self.Set(i, fn(v, i)) })
}
func (self *ApiGetSeriesImagesRequestStream) Select(fn func(ApiGetSeriesImagesRequest) interface{}) interface{} {
	_array := make([]interface{}, 0, len(*self))
	for _, v := range *self {
		_array = append(_array, fn(v))
	}
	return _array
}
func (self *ApiGetSeriesImagesRequestStream) Set(index int, val ApiGetSeriesImagesRequest) *ApiGetSeriesImagesRequestStream {
	if len(*self) > index && index >= 0 {
		(*self)[index] = val
	}
	return self
}
func (self *ApiGetSeriesImagesRequestStream) Skip(skip int) *ApiGetSeriesImagesRequestStream {
	return self.Slice(skip, self.Len()-skip)
}
func (self *ApiGetSeriesImagesRequestStream) SkippingEach(fn func(ApiGetSeriesImagesRequest, int) int) *ApiGetSeriesImagesRequestStream {
	for i := 0; i < self.Len(); i++ {
		skip := fn(*self.Get(i), i)
		i += skip
	}
	return self
}
func (self *ApiGetSeriesImagesRequestStream) Slice(startIndex, n int) *ApiGetSeriesImagesRequestStream {
	if last := startIndex + n; len(*self)-1 < startIndex || last < 0 || startIndex < 0 {
		*self = []ApiGetSeriesImagesRequest{}
	} else if len(*self) < last {
		*self = (*self)[startIndex:len(*self)]
	} else {
		*self = (*self)[startIndex:last]
	}
	return self
}
func (self *ApiGetSeriesImagesRequestStream) Sort(fn func(i, j int) bool) *ApiGetSeriesImagesRequestStream {
	sort.SliceStable(*self, fn)
	return self
}

func (self *ApiGetSeriesImagesRequestStream) Tail() *ApiGetSeriesImagesRequest {
	return self.Last()
}
func (self *ApiGetSeriesImagesRequestStream) TailOr(arg ApiGetSeriesImagesRequest) ApiGetSeriesImagesRequest {
	return self.LastOr(arg)
}
func (self *ApiGetSeriesImagesRequestStream) ToList() []ApiGetSeriesImagesRequest {
	return self.Val()
}
func (self *ApiGetSeriesImagesRequestStream) Unique() *ApiGetSeriesImagesRequestStream {
	return self.Distinct()
}
func (self *ApiGetSeriesImagesRequestStream) Val() []ApiGetSeriesImagesRequest {
	if self == nil {
		return []ApiGetSeriesImagesRequest{}
	}
	return *self.Copy()
}
func (self *ApiGetSeriesImagesRequestStream) While(fn func(ApiGetSeriesImagesRequest, int) bool) *ApiGetSeriesImagesRequestStream {
	for i, v := range self.Val() {
		if !fn(v, i) {
			break
		}
	}
	return self
}
func (self *ApiGetSeriesImagesRequestStream) Where(fn func(ApiGetSeriesImagesRequest) bool) *ApiGetSeriesImagesRequestStream {
	result := ApiGetSeriesImagesRequestStreamOf()
	for _, v := range *self {
		if fn(v) {
			result.Add(v)
		}
	}
	*self = result
	return self
}
func (self *ApiGetSeriesImagesRequestStream) WhereSlim(fn func(ApiGetSeriesImagesRequest) bool) *ApiGetSeriesImagesRequestStream {
	result := ApiGetSeriesImagesRequestStreamOf()
	caches := map[string]bool{}
	for _, v := range *self {
		key := fmt.Sprintf("%+v", v)
		if f, ok := caches[key]; ok {
			if f {
				result.Add(v)
			}
		} else if caches[key] = fn(v); caches[key] {
			result.Add(v)
		}
	}
	*self = result
	return self
}
