package migrationAPI import "time" type ( // Options defines the possible options for API calls to the migration API Options struct { Account *int // account number uri param Device *int // device number uri param HTTPTimeout *time.Duration // http client timeout HypMatchSource *bool // hypMatchSource for validate MoveGroup *string // move_group uri param UnipedeAge *int // unipedeAge query value UpdateStatus *bool // updateStatus query value Variance *string // variance value uri param Zone *string // zone value uri param } ) // SetAccount defines the account number for the request func (o *Options) SetAccount(accountNumber int) *Options { o.Account = &accountNumber return o } // SetDevice defines the device number for the request func (o *Options) SetDevice(deviceNumber int) *Options { o.Device = &deviceNumber return o } // SetHTTPTimeout defines the HTTP timeout for the request func (o *Options) SetHTTPTimeout(seconds time.Duration) *Options { o.HTTPTimeout = &seconds return o } // SetHypMatchSource sets the hypMatchSource flag func (o *Options) SetHypMatchSource(hypMatchSource bool) *Options { o.HypMatchSource = &hypMatchSource return o } // SetMoveGroup defines the device number for the request func (o *Options) SetMoveGroup(moveGroup string) *Options { o.MoveGroup = &moveGroup return o } // SetUnipedeAge defines the unipedeAge value for the request func (o *Options) SetUnipedeAge(seconds int) *Options { o.UnipedeAge = &seconds return o } // SetUpdateStatus defines the updateStatus boolean value for the request func (o *Options) SetUpdateStatus(updateStatus bool) *Options { o.UpdateStatus = &updateStatus return o } // SetVariance defines the variance uri param for the request func (o *Options) SetVariance(variance string) *Options { o.Variance = &variance return o } // SetZone defines the zone value for the request func (o *Options) SetZone(zone string) *Options { o.Zone = &zone return o } func processOptions(options ...*Options) *Options { o := new(Options) // options are merged into a single struct in a last-one-wins fashion for _, option := range options { if option == nil { continue } if option.Account != nil { o.Account = option.Account } if option.Device != nil { o.Device = option.Device } if option.HTTPTimeout != nil { o.HTTPTimeout = option.HTTPTimeout } if option.HypMatchSource != nil { o.HypMatchSource = option.HypMatchSource } if option.MoveGroup != nil { o.MoveGroup = option.MoveGroup } if option.UnipedeAge != nil { o.UnipedeAge = option.UnipedeAge } if option.UpdateStatus != nil { o.UpdateStatus = option.UpdateStatus } if option.Variance != nil { o.Variance = option.Variance } if option.Zone != nil { o.Zone = option.Zone } } return o }